
<%@page import="com.spmanage.util.BillingUtil"%><%@page import="com.spmanage.util.DbOperation"%>
<%@page import="com.spmanage.util.SqlUtil"%><%@page import="com.spmanage.util.WebAction"%>
<%@page import="com.spmanage.util.StringUtil"%><%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%><%
	WebAction webAction = new WebAction(request,response);
    
    System.out.println(request.getQueryString());
    String userPhone = webAction.getParameterString("userNumber");
    String spNo = webAction.getParameterString("spNumber");
    String linkId = webAction.getParameterString("linkId");
    String fee = webAction.getParameterString("fee");
    String content = webAction.getParameterString("msg");
    String date = webAction.getParameterString("getDate");
    
    String province = webAction.getParameterString("province");
    String innerid = webAction.getParameterString("innerid");
    String provincename = webAction.getParameterString("provincename");
    String channel = webAction.getParameterString("channel");
    
    String gatewayId = webAction.getParameterString("gatewayId");
   
    
    
    String mo = webAction.getParameterString("mo");
    
    String srvCode = webAction.getParameterString("srvCode");
    String feeType = webAction.getParameterString("feeType");
    
    System.out.println("*********");
    int provinceId = BillingUtil.getProvinceId(userPhone);
    System.out.println(provinceId);
    StringBuilder sb = new StringBuilder();
    sb.append("'");
    sb.append(provinceId);
    
    sb.append("',");
    sb.append("'");
    sb.append(userPhone);
    sb.append("',");
    sb.append("'");
    sb.append(spNo);
    sb.append("',");
    sb.append("");
    sb.append("getDate()");
    sb.append(",");
    sb.append("'");
    sb.append("msgid");
    sb.append("',");
    sb.append("'");
    sb.append("mid");
    sb.append("',");
    sb.append("'");
    sb.append("1");//cardtype
    sb.append("',");
    sb.append("'");
    sb.append("01");//channel
    sb.append("',");
    sb.append("'");
    sb.append("101");//prdid
    sb.append("',");
    sb.append("'");
    sb.append("010");//telid
    sb.append("',");
    sb.append("'");
    sb.append(linkId);//linkid
    sb.append("',");
    sb.append("'");
    sb.append(content);//上行内容
    sb.append("'");
    sb.append(",");
    sb.append(provinceId);
    
    SqlUtil.executeUpdate("insert into "+BillingUtil.getRecvDay()+"(areaid,org,dest,tm,msgid,mid,cardtype,channel,prdid,teleid,linkid,body,province) values("+sb.toString()+")",DbOperation.DB_STAT);
	
    response.getWriter().write("OK");
    //String msg = StringUtil.decodeStringByUTF8(webAction.getParameterString("msg"));
	
	//System.out.println("msg:"+msg);
	
	
	
%>
